package cn.linstudy.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description 封装返回结果对象
 * @Author XiaoLin
 * @Date 2021/3/2 11:36
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class ResponseResult {
  private Integer code;
  private String msg;
  private Object data;

  public ResponseResult(Integer code, String msg) {
    this.code = code;
    this.msg = msg;
  }

  public static final ResponseResult SUCCESS(String msg,Object data){
    return new ResponseResult(200,msg,data);
  }

  public static final ResponseResult SUCCESS(){
    return new ResponseResult(200,"成功");
  }

  public static final ResponseResult FAILTH(Integer code,String msg){
    return new ResponseResult(code,msg);
  }
}
